﻿<phone:PhoneApplicationPage 
    x:Class="DevPhoneToolkitSample.Samples.ClipAttachedSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:DevPhone="clr-namespace:DevPhone.Controls;assembly=DevPhone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel>
            <Border Background="White" VerticalAlignment="Top" BorderBrush="Gray" BorderThickness="1">
                <Image Name="Logo" Source="/DevPhoneToolkitSample;component/Images/DevPhoneToolkit.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" />
            </Border>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,20,12,10">
            <StackPanel>
                <TextBlock Text="Clip Attached Service Sample" FontSize="32"/>
                <TextBlock Text="Clip to Bounds in any control." TextWrapping="Wrap" FontSize="18" Margin="0,0,0,10" />
                <TextBlock Text="Without Clip" TextWrapping="Wrap" FontSize="24" Margin="0,0,0,0" FontWeight="Bold" />
                <StackPanel>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Grid Grid.Column="0" Background="Blue" Margin="20" Height="180" VerticalAlignment="Top">
                            <TextBlock Text="Grid" Margin="10,5,0,0" />
                            <Grid Background="Yellow" Margin="20,40,-20,20">
                                <Ellipse Fill="LightGreen" Width="80" Height="80" Margin="-40, -40, 0, 0"/>
                            </Grid>
                        </Grid>
                        <Canvas Grid.Column="1"  Background="Aqua" Margin="20" Height="180" VerticalAlignment="Top">
                            <TextBlock Text="canvas" Canvas.Left="120" Foreground="#FF030303" />
                            <Ellipse Fill="Red" Canvas.Top="-10" 
		                Canvas.Left="-10" Width="130" Height="130"/>
                        </Canvas>
                    </Grid>
                </StackPanel>
                <TextBlock Text="With Clip attached service" TextWrapping="Wrap" FontSize="24" Margin="0,0,0,0" FontWeight="Bold" />
                <StackPanel>
                    <Grid  >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Grid Grid.Column="0" Background="Blue" Margin="20" Height="180" VerticalAlignment="Top" DevPhone:ClipBoundsControl.ToBounds="True">
                            <TextBlock Text="Grid" Margin="10,5,0,0" />
                            <Grid Background="Yellow" Margin="20,40,-20,20">
                                <Ellipse Fill="LightGreen" Width="80" Height="80" Margin="-40, -40, 0, 0"/>
                            </Grid>
                        </Grid>
                        <Canvas Grid.Column="1"  Background="Aqua" Margin="20" Height="180" VerticalAlignment="Top" DevPhone:ClipBoundsControl.ToBounds="True">
                            <TextBlock Text="canvas" Canvas.Left="120" Foreground="#FF030303" />
                            <Ellipse Fill="Red" Canvas.Top="-10" 
		                Canvas.Left="-10" Width="130" Height="130"/>
                        </Canvas>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>
